package com.flyduck.system.vo.role.trans;


import cn.hutool.core.bean.BeanUtil;
import com.flyduck.system.entity.SysRoleEntity;
import com.flyduck.system.vo.role.SysRoleRespVO;
import com.google.common.base.Function;


/**
 * @program: flyduck-platform
 * @description:
 * @author: flyduck
 * @create: 2021-02-01 12:42
 **/
public class SysRoleEntityToSysRoleRespVO implements Function<SysRoleEntity, SysRoleRespVO> {

    @Override
    public SysRoleRespVO apply(SysRoleEntity entity) {
        SysRoleRespVO sysRoleRespVO = new SysRoleRespVO();
        BeanUtil.copyProperties(entity,sysRoleRespVO);
        sysRoleRespVO.setId(entity.getId()+"");
        sysRoleRespVO.setSort(String.valueOf(entity.getSort()));
        return sysRoleRespVO;
    }
}
